﻿using System;
using System.Data;
using System.Text;
using System.Collections.Generic;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Data.Sql;
using System.Data.Common;

namespace Chenxin.Lib.Business.DAL
{
    /// <summary>
    /// 数据访问类t_Business_Record_BaseInfo。
    /// </summary>
    public class t_Business_Record_BaseInfo
    {
        public t_Business_Record_BaseInfo()
        { }
        #region  成员方法

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public static void Add(Chenxin.Lib.Business.Entity.t_Business_Record_BaseInfo model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into t_Business_Record_BaseInfo(");
            strSql.Append("RecordId,HouseId,HouseCode,HouseAddress,BuildingArea,PropertyCode,CompleteYear,Total_Floor,Cur_Floor,BuildingType,HouseUse,BelongUserCityId,BelongUserCityName,BelongUserCompanyId,BelongUserCompanyName,BelongUserDepartmentId,BelongUserDepartmentName,BelongUserId,BelongUserName,CityId,CityName,CompanyId,CompanyName,DepartId,DepartName,EmployeeId,Employee,LoanInfo,BargainTime,LoanTime,BargainType,WorkCityId,WorkCityName,WorkCompanyId,WorkCompanyName,WorkDepartId,WorkDepartName,WorkPersonId,WorkPersonName,BargainCityId,BargainCityName,BargainCompanyId,BargainCompanyName,Mobile,SpecialInfo,TotalPrice,Unit,FitPrice,MortgageInfo,FariInfo,PayLoanDay,PayMode,RepairFund,GiveHouseTime,Remark,FairPoint,LoanAnswerContent,LoanIsAnswer,LawAnswerContent,LawIsAnswer,ApplyDocAnswerContent,ApplyDocIsAnswer,AnswersNum,IsAnswer,AnswerTime,Status,CreateCityId,CreateCityName,CreateCompanyId,CreateCompanyName,CreateDepartmentId,CreateDepartmentName,CreateUserId,CreateUserName,CreateTime,UpdateCityId,UpdateCityName,UpdateCompanyId,UpdateCompanyName,UpdateDepartmentId,UpdateDepartmentName,UpdateUserId,UpdateUserName,UpdateTime,VenderTel,VenderAddress,BuyerAddress,BuyerTel,EvaluatePrice,LonggevityLevel,LoanBank,EvaluateCompany,FundLoanPrice,FundLoanEndYear,BusinessLoanPrice,BusinessLoanEndYear,Prejudication,TransferDate)");

            strSql.Append(" values (");
            strSql.Append("@RecordId,@HouseId,@HouseCode,@HouseAddress,@BuildingArea,@PropertyCode,@CompleteYear,@Total_Floor,@Cur_Floor,@BuildingType,@HouseUse,@BelongUserCityId,@BelongUserCityName,@BelongUserCompanyId,@BelongUserCompanyName,@BelongUserDepartmentId,@BelongUserDepartmentName,@BelongUserId,@BelongUserName,@CityId,@CityName,@CompanyId,@CompanyName,@DepartId,@DepartName,@EmployeeId,@Employee,@LoanInfo,@BargainTime,@LoanTime,@BargainType,@WorkCityId,@WorkCityName,@WorkCompanyId,@WorkCompanyName,@WorkDepartId,@WorkDepartName,@WorkPersonId,@WorkPersonName,@BargainCityId,@BargainCityName,@BargainCompanyId,@BargainCompanyName,@Mobile,@SpecialInfo,@TotalPrice,@Unit,@FitPrice,@MortgageInfo,@FariInfo,@PayLoanDay,@PayMode,@RepairFund,@GiveHouseTime,@Remark,@FairPoint,@LoanAnswerContent,@LoanIsAnswer,@LawAnswerContent,@LawIsAnswer,@ApplyDocAnswerContent,@ApplyDocIsAnswer,@AnswersNum,@IsAnswer,@AnswerTime,@Status,@CreateCityId,@CreateCityName,@CreateCompanyId,@CreateCompanyName,@CreateDepartmentId,@CreateDepartmentName,@CreateUserId,@CreateUserName,@CreateTime,@UpdateCityId,@UpdateCityName,@UpdateCompanyId,@UpdateCompanyName,@UpdateDepartmentId,@UpdateDepartmentName,@UpdateUserId,@UpdateUserName,@UpdateTime,@VenderTel,@VenderAddress,@BuyerAddress,@BuyerTel,@EvaluatePrice,@LonggevityLevel,@LoanBank,@EvaluateCompany,@FundLoanPrice,@FundLoanEndYear,@BusinessLoanPrice,@BusinessLoanEndYear,@Prejudication,@TransferDate)");
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business");
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "RecordId", DbType.Guid, model.RecordId);
            db.AddInParameter(dbCommand, "HouseId", DbType.Guid, model.HouseId);
            db.AddInParameter(dbCommand, "HouseCode", DbType.AnsiString, model.HouseCode);
            db.AddInParameter(dbCommand, "HouseAddress", DbType.AnsiString, model.HouseAddress);
            db.AddInParameter(dbCommand, "PropertyCode", DbType.AnsiString, model.PropertyCode);
            db.AddInParameter(dbCommand, "BuildingArea", DbType.Decimal, model.BuildingArea);
            db.AddInParameter(dbCommand, "CompleteYear", DbType.AnsiString, model.CompleteYear);
            db.AddInParameter(dbCommand, "Total_Floor", DbType.Int32, model.Total_Floor);
            db.AddInParameter(dbCommand, "Cur_Floor", DbType.Int32, model.Cur_Floor);
            db.AddInParameter(dbCommand, "BuildingType", DbType.AnsiString, model.BuildingType);
            db.AddInParameter(dbCommand, "HouseUse", DbType.AnsiString, model.HouseUse);
            db.AddInParameter(dbCommand, "BelongUserCityId", DbType.Guid, model.BelongUserCityId);
            db.AddInParameter(dbCommand, "BelongUserCityName", DbType.AnsiString, model.BelongUserCityName);
            db.AddInParameter(dbCommand, "BelongUserCompanyId", DbType.Guid, model.BelongUserCompanyId);
            db.AddInParameter(dbCommand, "BelongUserCompanyName", DbType.AnsiString, model.BelongUserCompanyName);
            db.AddInParameter(dbCommand, "BelongUserDepartmentId", DbType.Guid, model.BelongUserDepartmentId);
            db.AddInParameter(dbCommand, "BelongUserDepartmentName", DbType.AnsiString, model.BelongUserDepartmentName);
            db.AddInParameter(dbCommand, "BelongUserId", DbType.Guid, model.BelongUserId);
            db.AddInParameter(dbCommand, "BelongUserName", DbType.AnsiString, model.BelongUserName);
            db.AddInParameter(dbCommand, "CityId", DbType.Guid, model.CityId);
            db.AddInParameter(dbCommand, "CityName", DbType.AnsiString, model.CityName);
            db.AddInParameter(dbCommand, "CompanyId", DbType.Guid, model.CompanyId);
            db.AddInParameter(dbCommand, "CompanyName", DbType.AnsiString, model.CompanyName);
            db.AddInParameter(dbCommand, "DepartId", DbType.Guid, model.DepartId);
            db.AddInParameter(dbCommand, "DepartName", DbType.AnsiString, model.DepartName);
            db.AddInParameter(dbCommand, "EmployeeId", DbType.Guid, model.EmployeeId);
            db.AddInParameter(dbCommand, "Employee", DbType.AnsiString, model.Employee);
            db.AddInParameter(dbCommand, "LoanInfo", DbType.AnsiString, model.LoanInfo);
            db.AddInParameter(dbCommand, "BargainTime", DbType.DateTime, model.BargainTime);
            db.AddInParameter(dbCommand, "LoanTime", DbType.DateTime, model.LoanTime);
            db.AddInParameter(dbCommand, "BargainType", DbType.AnsiString, model.BargainType);
            db.AddInParameter(dbCommand, "WorkCityId", DbType.Guid, model.WorkCityId);
            db.AddInParameter(dbCommand, "WorkCityName", DbType.AnsiString, model.WorkCityName);
            db.AddInParameter(dbCommand, "WorkCompanyId", DbType.Guid, model.WorkCompanyId);
            db.AddInParameter(dbCommand, "WorkCompanyName", DbType.AnsiString, model.WorkCompanyName);
            db.AddInParameter(dbCommand, "WorkDepartId", DbType.Guid, model.WorkDepartId);
            db.AddInParameter(dbCommand, "WorkDepartName", DbType.AnsiString, model.WorkDepartName);
            db.AddInParameter(dbCommand, "WorkPersonId", DbType.Guid, model.WorkPersonId);
            db.AddInParameter(dbCommand, "WorkPersonName", DbType.AnsiString, model.WorkPersonName);
            db.AddInParameter(dbCommand, "BargainCityId", DbType.Guid, model.BargainCityId);
            db.AddInParameter(dbCommand, "BargainCityName", DbType.AnsiString, model.BargainCityName);
            db.AddInParameter(dbCommand, "BargainCompanyId", DbType.Guid, model.BargainCompanyId);
            db.AddInParameter(dbCommand, "BargainCompanyName", DbType.AnsiString, model.BargainCompanyName);
            db.AddInParameter(dbCommand, "Mobile", DbType.AnsiString, model.Mobile);
            db.AddInParameter(dbCommand, "SpecialInfo", DbType.AnsiString, model.SpecialInfo);
            db.AddInParameter(dbCommand, "TotalPrice", DbType.Decimal, model.TotalPrice);
            db.AddInParameter(dbCommand, "Unit", DbType.AnsiString, model.Unit);
            db.AddInParameter(dbCommand, "FitPrice", DbType.Decimal, model.FitPrice);
            db.AddInParameter(dbCommand, "MortgageInfo", DbType.AnsiString, model.MortgageInfo);
            db.AddInParameter(dbCommand, "FariInfo", DbType.AnsiString, model.FariInfo);
            db.AddInParameter(dbCommand, "PayLoanDay", DbType.AnsiString, model.PayLoanDay);
            db.AddInParameter(dbCommand, "PayMode", DbType.String, model.PayMode);
            db.AddInParameter(dbCommand, "RepairFund", DbType.AnsiString, model.RepairFund);
            db.AddInParameter(dbCommand, "GiveHouseTime", DbType.AnsiString, model.GiveHouseTime);
            db.AddInParameter(dbCommand, "Remark", DbType.AnsiString, model.Remark);
            db.AddInParameter(dbCommand, "FairPoint", DbType.AnsiString, model.FairPoint);
            db.AddInParameter(dbCommand, "LoanAnswerContent", DbType.AnsiString, model.LoanAnswerContent);
            db.AddInParameter(dbCommand, "LoanIsAnswer", DbType.Boolean, model.LoanIsAnswer);
            db.AddInParameter(dbCommand, "LawAnswerContent", DbType.AnsiString, model.LawAnswerContent);
            db.AddInParameter(dbCommand, "LawIsAnswer", DbType.Boolean, model.LawIsAnswer);
            db.AddInParameter(dbCommand, "ApplyDocAnswerContent", DbType.AnsiString, model.ApplyDocAnswerContent);
            db.AddInParameter(dbCommand, "ApplyDocIsAnswer", DbType.Boolean, model.ApplyDocIsAnswer);
            db.AddInParameter(dbCommand, "AnswersNum", DbType.Int32, model.AnswersNum);
            db.AddInParameter(dbCommand, "IsAnswer", DbType.Boolean, model.IsAnswer);
            db.AddInParameter(dbCommand, "AnswerTime", DbType.DateTime, model.AnswerTime);
            db.AddInParameter(dbCommand, "Status", DbType.Int16, model.Status);
            db.AddInParameter(dbCommand, "CreateCityId", DbType.Guid, model.CreateCityId);
            db.AddInParameter(dbCommand, "CreateCityName", DbType.AnsiString, model.CreateCityName);
            db.AddInParameter(dbCommand, "CreateCompanyId", DbType.Guid, model.CreateCompanyId);
            db.AddInParameter(dbCommand, "CreateCompanyName", DbType.AnsiString, model.CreateCompanyName);
            db.AddInParameter(dbCommand, "CreateDepartmentId", DbType.Guid, model.CreateDepartmentId);
            db.AddInParameter(dbCommand, "CreateDepartmentName", DbType.AnsiString, model.CreateDepartmentName);
            db.AddInParameter(dbCommand, "CreateUserId", DbType.Guid, model.CreateUserId);
            db.AddInParameter(dbCommand, "CreateUserName", DbType.AnsiString, model.CreateUserName);
            db.AddInParameter(dbCommand, "CreateTime", DbType.DateTime, model.CreateTime);
            db.AddInParameter(dbCommand, "UpdateCityId", DbType.Guid, model.UpdateCityId);
            db.AddInParameter(dbCommand, "UpdateCityName", DbType.AnsiString, model.UpdateCityName);
            db.AddInParameter(dbCommand, "UpdateCompanyId", DbType.Guid, model.UpdateCompanyId);
            db.AddInParameter(dbCommand, "UpdateCompanyName", DbType.AnsiString, model.UpdateCompanyName);
            db.AddInParameter(dbCommand, "UpdateDepartmentId", DbType.Guid, model.UpdateDepartmentId);
            db.AddInParameter(dbCommand, "UpdateDepartmentName", DbType.AnsiString, model.UpdateDepartmentName);
            db.AddInParameter(dbCommand, "UpdateUserId", DbType.Guid, model.UpdateUserId);
            db.AddInParameter(dbCommand, "UpdateUserName", DbType.AnsiString, model.UpdateUserName);
            db.AddInParameter(dbCommand, "UpdateTime", DbType.DateTime, model.UpdateTime);
            db.AddInParameter(dbCommand, "VenderTel", DbType.AnsiString, model.VenderTel);
            db.AddInParameter(dbCommand, "VenderAddress", DbType.AnsiString, model.VenderAddress);
            db.AddInParameter(dbCommand, "BuyerAddress", DbType.AnsiString, model.BuyerAddress);
            db.AddInParameter(dbCommand, "BuyerTel", DbType.AnsiString, model.BuyerTel);
            db.AddInParameter(dbCommand, "EvaluatePrice", DbType.Currency, model.EvaluatePrice);
            db.AddInParameter(dbCommand, "LonggevityLevel", DbType.AnsiString, model.LonggevityLevel);
            db.AddInParameter(dbCommand, "LoanBank", DbType.AnsiString, model.LoanBank);
            db.AddInParameter(dbCommand, "EvaluateCompany", DbType.AnsiString, model.EvaluateCompany);
            db.AddInParameter(dbCommand, "FundLoanPrice", DbType.Currency, model.FundLoanPrice);
            db.AddInParameter(dbCommand, "FundLoanEndYear", DbType.AnsiString, model.FundLoanEndYear);
            db.AddInParameter(dbCommand, "BusinessLoanPrice", DbType.Currency, model.BusinessLoanPrice);
            db.AddInParameter(dbCommand, "BusinessLoanEndYear", DbType.AnsiString, model.BusinessLoanEndYear);
            db.AddInParameter(dbCommand, "Prejudication", DbType.AnsiString, model.Prejudication);
            db.AddInParameter(dbCommand, "TransferDate", DbType.DateTime, model.TransferDate);
            db.ExecuteNonQuery(dbCommand);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public static void Update(Chenxin.Lib.Business.Entity.t_Business_Record_BaseInfo model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update t_Business_Record_BaseInfo set ");
            strSql.Append("HouseId=@HouseId,");
            strSql.Append("HouseCode=@HouseCode,");
            strSql.Append("HouseAddress=@HouseAddress,");
            strSql.Append("BuildingArea=@BuildingArea,");
            strSql.Append("PropertyCode=@PropertyCode,");
            strSql.Append("CompleteYear=@CompleteYear,");
            strSql.Append("Total_Floor=@Total_Floor,");
            strSql.Append("Cur_Floor=@Cur_Floor,");
            strSql.Append("BuildingType=@BuildingType,");
            strSql.Append("HouseUse=@HouseUse,");
            strSql.Append("BelongUserCityId=@BelongUserCityId,");
            strSql.Append("BelongUserCityName=@BelongUserCityName,");
            strSql.Append("BelongUserCompanyId=@BelongUserCompanyId,");
            strSql.Append("BelongUserCompanyName=@BelongUserCompanyName,");
            strSql.Append("BelongUserDepartmentId=@BelongUserDepartmentId,");
            strSql.Append("BelongUserDepartmentName=@BelongUserDepartmentName,");
            strSql.Append("BelongUserId=@BelongUserId,");
            strSql.Append("BelongUserName=@BelongUserName,");
            strSql.Append("CityId=@CityId,");
            strSql.Append("CityName=@CityName,");
            strSql.Append("CompanyId=@CompanyId,");
            strSql.Append("CompanyName=@CompanyName,");
            strSql.Append("DepartId=@DepartId,");
            strSql.Append("DepartName=@DepartName,");
            strSql.Append("EmployeeId=@EmployeeId,");
            strSql.Append("Employee=@Employee,");
            strSql.Append("LoanInfo=@LoanInfo,");
            strSql.Append("BargainTime=@BargainTime,");
            strSql.Append("LoanTime=@LoanTime,");
            strSql.Append("BargainType=@BargainType,");
            strSql.Append("WorkCityId=@WorkCityId,");
            strSql.Append("WorkCityName=@WorkCityName,");
            strSql.Append("WorkCompanyId=@WorkCompanyId,");
            strSql.Append("WorkCompanyName=@WorkCompanyName,");
            strSql.Append("WorkDepartId=@WorkDepartId,");
            strSql.Append("WorkDepartName=@WorkDepartName,");
            strSql.Append("WorkPersonId=@WorkPersonId,");
            strSql.Append("WorkPersonName=@WorkPersonName,");
            strSql.Append("BargainCityId=@BargainCityId,");
            strSql.Append("BargainCityName=@BargainCityName,");
            strSql.Append("BargainCompanyId=@BargainCompanyId,");
            strSql.Append("BargainCompanyName=@BargainCompanyName,");
            strSql.Append("Mobile=@Mobile,");
            strSql.Append("SpecialInfo=@SpecialInfo,");
            strSql.Append("TotalPrice=@TotalPrice,");
            strSql.Append("Unit=@Unit,");
            strSql.Append("FitPrice=@FitPrice,");
            strSql.Append("MortgageInfo=@MortgageInfo,");
            strSql.Append("FariInfo=@FariInfo,");
            strSql.Append("PayLoanDay=@PayLoanDay,");
            strSql.Append("PayMode=@PayMode,");
            strSql.Append("RepairFund=@RepairFund,");
            strSql.Append("GiveHouseTime=@GiveHouseTime,");
            strSql.Append("Remark=@Remark,");
            strSql.Append("FairPoint=@FairPoint,");
            strSql.Append("LoanAnswerContent=@LoanAnswerContent,");
            strSql.Append("LoanIsAnswer=@LoanIsAnswer,");
            strSql.Append("LawAnswerContent=@LawAnswerContent,");
            strSql.Append("LawIsAnswer=@LawIsAnswer,");
            strSql.Append("ApplyDocAnswerContent=@ApplyDocAnswerContent,");
            strSql.Append("ApplyDocIsAnswer=@ApplyDocIsAnswer,");
            strSql.Append("AnswersNum=@AnswersNum,");
            strSql.Append("IsAnswer=@IsAnswer,");
            strSql.Append("AnswerTime=@AnswerTime,");
            strSql.Append("Status=@Status,");
            strSql.Append("CreateCityId=@CreateCityId,");
            strSql.Append("CreateCityName=@CreateCityName,");
            strSql.Append("CreateCompanyId=@CreateCompanyId,");
            strSql.Append("CreateCompanyName=@CreateCompanyName,");
            strSql.Append("CreateDepartmentId=@CreateDepartmentId,");
            strSql.Append("CreateDepartmentName=@CreateDepartmentName,");
            strSql.Append("CreateUserId=@CreateUserId,");
            strSql.Append("CreateUserName=@CreateUserName,");
            strSql.Append("CreateTime=@CreateTime,");
            strSql.Append("UpdateCityId=@UpdateCityId,");
            strSql.Append("UpdateCityName=@UpdateCityName,");
            strSql.Append("UpdateCompanyId=@UpdateCompanyId,");
            strSql.Append("UpdateCompanyName=@UpdateCompanyName,");
            strSql.Append("UpdateDepartmentId=@UpdateDepartmentId,");
            strSql.Append("UpdateDepartmentName=@UpdateDepartmentName,");
            strSql.Append("UpdateUserId=@UpdateUserId,");
            strSql.Append("UpdateUserName=@UpdateUserName,");
            strSql.Append("UpdateTime=@UpdateTime,");
            strSql.Append("VenderTel=@VenderTel,");
            strSql.Append("VenderAddress=@VenderAddress,");
            strSql.Append("BuyerAddress=@BuyerAddress,");
            strSql.Append("BuyerTel=@BuyerTel,");
            strSql.Append("EvaluatePrice=@EvaluatePrice,");
            strSql.Append("LonggevityLevel=@LonggevityLevel,");
            strSql.Append("LoanBank=@LoanBank,");
            strSql.Append("EvaluateCompany=@EvaluateCompany,");
            strSql.Append("FundLoanPrice=@FundLoanPrice,");
            strSql.Append("FundLoanEndYear=@FundLoanEndYear,");
            strSql.Append("BusinessLoanPrice=@BusinessLoanPrice,");
            strSql.Append("BusinessLoanEndYear=@BusinessLoanEndYear,");
            strSql.Append("Prejudication=@Prejudication,");
            strSql.Append("TransferDate=@TransferDate");
            strSql.Append(" where RecordId=@RecordId ");
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business");
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "RecordId", DbType.Guid, model.RecordId);
            db.AddInParameter(dbCommand, "HouseId", DbType.Guid, model.HouseId);
            db.AddInParameter(dbCommand, "HouseCode", DbType.AnsiString, model.HouseCode);
            db.AddInParameter(dbCommand, "HouseAddress", DbType.AnsiString, model.HouseAddress);
            db.AddInParameter(dbCommand, "PropertyCode", DbType.AnsiString, model.PropertyCode);
            db.AddInParameter(dbCommand, "BuildingArea", DbType.Decimal, model.BuildingArea);
            db.AddInParameter(dbCommand, "CompleteYear", DbType.AnsiString, model.CompleteYear);
            db.AddInParameter(dbCommand, "Total_Floor", DbType.Int32, model.Total_Floor);
            db.AddInParameter(dbCommand, "Cur_Floor", DbType.Int32, model.Cur_Floor);
            db.AddInParameter(dbCommand, "BuildingType", DbType.AnsiString, model.BuildingType);
            db.AddInParameter(dbCommand, "HouseUse", DbType.AnsiString, model.HouseUse);
            db.AddInParameter(dbCommand, "BelongUserCityId", DbType.Guid, model.BelongUserCityId);
            db.AddInParameter(dbCommand, "BelongUserCityName", DbType.AnsiString, model.BelongUserCityName);
            db.AddInParameter(dbCommand, "BelongUserCompanyId", DbType.Guid, model.BelongUserCompanyId);
            db.AddInParameter(dbCommand, "BelongUserCompanyName", DbType.AnsiString, model.BelongUserCompanyName);
            db.AddInParameter(dbCommand, "BelongUserDepartmentId", DbType.Guid, model.BelongUserDepartmentId);
            db.AddInParameter(dbCommand, "BelongUserDepartmentName", DbType.AnsiString, model.BelongUserDepartmentName);
            db.AddInParameter(dbCommand, "BelongUserId", DbType.Guid, model.BelongUserId);
            db.AddInParameter(dbCommand, "BelongUserName", DbType.AnsiString, model.BelongUserName);
            db.AddInParameter(dbCommand, "CityId", DbType.Guid, model.CityId);
            db.AddInParameter(dbCommand, "CityName", DbType.AnsiString, model.CityName);
            db.AddInParameter(dbCommand, "CompanyId", DbType.Guid, model.CompanyId);
            db.AddInParameter(dbCommand, "CompanyName", DbType.AnsiString, model.CompanyName);
            db.AddInParameter(dbCommand, "DepartId", DbType.Guid, model.DepartId);
            db.AddInParameter(dbCommand, "DepartName", DbType.AnsiString, model.DepartName);
            db.AddInParameter(dbCommand, "EmployeeId", DbType.Guid, model.EmployeeId);
            db.AddInParameter(dbCommand, "Employee", DbType.AnsiString, model.Employee);
            db.AddInParameter(dbCommand, "LoanInfo", DbType.AnsiString, model.LoanInfo);
            db.AddInParameter(dbCommand, "BargainTime", DbType.DateTime, model.BargainTime);
            db.AddInParameter(dbCommand, "LoanTime", DbType.DateTime, model.LoanTime);
            db.AddInParameter(dbCommand, "BargainType", DbType.AnsiString, model.BargainType);
            db.AddInParameter(dbCommand, "WorkCityId", DbType.Guid, model.WorkCityId);
            db.AddInParameter(dbCommand, "WorkCityName", DbType.AnsiString, model.WorkCityName);
            db.AddInParameter(dbCommand, "WorkCompanyId", DbType.Guid, model.WorkCompanyId);
            db.AddInParameter(dbCommand, "WorkCompanyName", DbType.AnsiString, model.WorkCompanyName);
            db.AddInParameter(dbCommand, "WorkDepartId", DbType.Guid, model.WorkDepartId);
            db.AddInParameter(dbCommand, "WorkDepartName", DbType.AnsiString, model.WorkDepartName);
            db.AddInParameter(dbCommand, "WorkPersonId", DbType.Guid, model.WorkPersonId);
            db.AddInParameter(dbCommand, "WorkPersonName", DbType.AnsiString, model.WorkPersonName);
            db.AddInParameter(dbCommand, "BargainCityId", DbType.Guid, model.BargainCityId);
            db.AddInParameter(dbCommand, "BargainCityName", DbType.AnsiString, model.BargainCityName);
            db.AddInParameter(dbCommand, "BargainCompanyId", DbType.Guid, model.BargainCompanyId);
            db.AddInParameter(dbCommand, "BargainCompanyName", DbType.AnsiString, model.BargainCompanyName);
            db.AddInParameter(dbCommand, "Mobile", DbType.AnsiString, model.Mobile);
            db.AddInParameter(dbCommand, "SpecialInfo", DbType.AnsiString, model.SpecialInfo);
            db.AddInParameter(dbCommand, "TotalPrice", DbType.Decimal, model.TotalPrice);
            db.AddInParameter(dbCommand, "Unit", DbType.AnsiString, model.Unit);
            db.AddInParameter(dbCommand, "FitPrice", DbType.Decimal, model.FitPrice);
            db.AddInParameter(dbCommand, "MortgageInfo", DbType.AnsiString, model.MortgageInfo);
            db.AddInParameter(dbCommand, "FariInfo", DbType.AnsiString, model.FariInfo);
            db.AddInParameter(dbCommand, "PayLoanDay", DbType.AnsiString, model.PayLoanDay);
            db.AddInParameter(dbCommand, "PayMode", DbType.String, model.PayMode);
            db.AddInParameter(dbCommand, "RepairFund", DbType.AnsiString, model.RepairFund);
            db.AddInParameter(dbCommand, "GiveHouseTime", DbType.AnsiString, model.GiveHouseTime);
            db.AddInParameter(dbCommand, "Remark", DbType.AnsiString, model.Remark);
            db.AddInParameter(dbCommand, "FairPoint", DbType.AnsiString, model.FairPoint);
            db.AddInParameter(dbCommand, "LoanAnswerContent", DbType.AnsiString, model.LoanAnswerContent);
            db.AddInParameter(dbCommand, "LoanIsAnswer", DbType.Boolean, model.LoanIsAnswer);
            db.AddInParameter(dbCommand, "LawAnswerContent", DbType.AnsiString, model.LawAnswerContent);
            db.AddInParameter(dbCommand, "LawIsAnswer", DbType.Boolean, model.LawIsAnswer);
            db.AddInParameter(dbCommand, "ApplyDocAnswerContent", DbType.AnsiString, model.ApplyDocAnswerContent);
            db.AddInParameter(dbCommand, "ApplyDocIsAnswer", DbType.Boolean, model.ApplyDocIsAnswer);
            db.AddInParameter(dbCommand, "AnswersNum", DbType.Int32, model.AnswersNum);
            db.AddInParameter(dbCommand, "IsAnswer", DbType.Boolean, model.IsAnswer);
            db.AddInParameter(dbCommand, "AnswerTime", DbType.DateTime, model.AnswerTime);
            db.AddInParameter(dbCommand, "Status", DbType.Int16, model.Status);
            db.AddInParameter(dbCommand, "CreateCityId", DbType.Guid, model.CreateCityId);
            db.AddInParameter(dbCommand, "CreateCityName", DbType.AnsiString, model.CreateCityName);
            db.AddInParameter(dbCommand, "CreateCompanyId", DbType.Guid, model.CreateCompanyId);
            db.AddInParameter(dbCommand, "CreateCompanyName", DbType.AnsiString, model.CreateCompanyName);
            db.AddInParameter(dbCommand, "CreateDepartmentId", DbType.Guid, model.CreateDepartmentId);
            db.AddInParameter(dbCommand, "CreateDepartmentName", DbType.AnsiString, model.CreateDepartmentName);
            db.AddInParameter(dbCommand, "CreateUserId", DbType.Guid, model.CreateUserId);
            db.AddInParameter(dbCommand, "CreateUserName", DbType.AnsiString, model.CreateUserName);
            db.AddInParameter(dbCommand, "CreateTime", DbType.DateTime, model.CreateTime);
            db.AddInParameter(dbCommand, "UpdateCityId", DbType.Guid, model.UpdateCityId);
            db.AddInParameter(dbCommand, "UpdateCityName", DbType.AnsiString, model.UpdateCityName);
            db.AddInParameter(dbCommand, "UpdateCompanyId", DbType.Guid, model.UpdateCompanyId);
            db.AddInParameter(dbCommand, "UpdateCompanyName", DbType.AnsiString, model.UpdateCompanyName);
            db.AddInParameter(dbCommand, "UpdateDepartmentId", DbType.Guid, model.UpdateDepartmentId);
            db.AddInParameter(dbCommand, "UpdateDepartmentName", DbType.AnsiString, model.UpdateDepartmentName);
            db.AddInParameter(dbCommand, "UpdateUserId", DbType.Guid, model.UpdateUserId);
            db.AddInParameter(dbCommand, "UpdateUserName", DbType.AnsiString, model.UpdateUserName);
            db.AddInParameter(dbCommand, "UpdateTime", DbType.DateTime, model.UpdateTime);
            db.AddInParameter(dbCommand, "VenderTel", DbType.AnsiString, model.VenderTel);
            db.AddInParameter(dbCommand, "VenderAddress", DbType.AnsiString, model.VenderAddress);
            db.AddInParameter(dbCommand, "BuyerAddress", DbType.AnsiString, model.BuyerAddress);
            db.AddInParameter(dbCommand, "BuyerTel", DbType.AnsiString, model.BuyerTel);
            db.AddInParameter(dbCommand, "EvaluatePrice", DbType.Currency, model.EvaluatePrice);
            db.AddInParameter(dbCommand, "LonggevityLevel", DbType.AnsiString, model.LonggevityLevel);
            db.AddInParameter(dbCommand, "LoanBank", DbType.AnsiString, model.LoanBank);
            db.AddInParameter(dbCommand, "EvaluateCompany", DbType.AnsiString, model.EvaluateCompany);
            db.AddInParameter(dbCommand, "FundLoanPrice", DbType.Currency, model.FundLoanPrice);
            db.AddInParameter(dbCommand, "FundLoanEndYear", DbType.AnsiString, model.FundLoanEndYear);
            db.AddInParameter(dbCommand, "BusinessLoanPrice", DbType.Currency, model.BusinessLoanPrice);
            db.AddInParameter(dbCommand, "BusinessLoanEndYear", DbType.AnsiString, model.BusinessLoanEndYear);
            db.AddInParameter(dbCommand, "Prejudication", DbType.AnsiString, model.Prejudication);
            db.AddInParameter(dbCommand, "TransferDate", DbType.DateTime, model.TransferDate);
            db.ExecuteNonQuery(dbCommand);

        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public static void Delete(Guid RecordId)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("delete from t_Business_Record_BaseInfo ");
            strSql.Append(" where RecordId=@RecordId ");
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business");
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "RecordId", DbType.Guid, RecordId);
            db.ExecuteNonQuery(dbCommand);

        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public static Chenxin.Lib.Business.Entity.t_Business_Record_BaseInfo GetModel(Guid RecordId)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("select RecordId,HouseId,HouseCode,HouseAddress,BuildingArea,PropertyCode,CompleteYear,Total_Floor,Cur_Floor,BuildingType,HouseUse,BelongUserCityId,BelongUserCityName,BelongUserCompanyId,BelongUserCompanyName,BelongUserDepartmentId,BelongUserDepartmentName,BelongUserId,BelongUserName,CityId,CityName,CompanyId,CompanyName,DepartId,DepartName,EmployeeId,Employee,LoanInfo,BargainTime,LoanTime,BargainType,WorkCityId,WorkCityName,WorkCompanyId,WorkCompanyName,WorkDepartId,WorkDepartName,WorkPersonId,WorkPersonName,BargainCityId,BargainCityName,BargainCompanyId,BargainCompanyName,Mobile,SpecialInfo,TotalPrice,Unit,FitPrice,MortgageInfo,FariInfo,PayLoanDay,PayMode,RepairFund,GiveHouseTime,Remark,FairPoint,LoanAnswerContent,LoanIsAnswer,LawAnswerContent,LawIsAnswer,ApplyDocAnswerContent,ApplyDocIsAnswer,AnswersNum,IsAnswer,AnswerTime,Status,CreateCityId,CreateCityName,CreateCompanyId,CreateCompanyName,CreateDepartmentId,CreateDepartmentName,CreateUserId,CreateUserName,CreateTime,UpdateCityId,UpdateCityName,UpdateCompanyId,UpdateCompanyName,UpdateDepartmentId,UpdateDepartmentName,UpdateUserId,UpdateUserName,UpdateTime,VenderTel,VenderAddress,BuyerAddress,BuyerTel,EvaluatePrice,LonggevityLevel,LoanBank,EvaluateCompany,FundLoanPrice,FundLoanEndYear,BusinessLoanPrice,BusinessLoanEndYear,Prejudication,TransferDate from t_Business_Record_BaseInfo ");
            strSql.Append(" where RecordId=@RecordId ");
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business_Search");
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "RecordId", DbType.Guid, RecordId);
            Chenxin.Lib.Business.Entity.t_Business_Record_BaseInfo model = null;
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                if (dataReader.Read())
                {
                    model = ReaderBind(dataReader);
                }
                dataReader.Close();
                dataReader.Dispose();
            }
            return model;
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public static DataSet GetList(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select RecordId,HouseId,HouseCode,HouseAddress,BuildingArea,PropertyCode,CompleteYear,Total_Floor,Cur_Floor,BuildingType,HouseUse,BelongUserCityId,BelongUserCityName,BelongUserCompanyId,BelongUserCompanyName,BelongUserDepartmentId,BelongUserDepartmentName,BelongUserId,BelongUserName,CityId,CityName,CompanyId,CompanyName,DepartId,DepartName,EmployeeId,Employee,LoanInfo,BargainTime,LoanTime,BargainType,WorkCityId,WorkCityName,WorkCompanyId,WorkCompanyName,WorkDepartId,WorkDepartName,WorkPersonId,WorkPersonName,BargainCityId,BargainCityName,BargainCompanyId,BargainCompanyName,Mobile,SpecialInfo,TotalPrice,Unit,FitPrice,MortgageInfo,FariInfo,PayLoanDay,PayMode,RepairFund,GiveHouseTime,Remark,FairPoint,LoanAnswerContent,LoanIsAnswer,LawAnswerContent,LawIsAnswer,ApplyDocAnswerContent,ApplyDocIsAnswer,AnswersNum,IsAnswer,AnswerTime,Status,CreateCityId,CreateCityName,CreateCompanyId,CreateCompanyName,CreateDepartmentId,CreateDepartmentName,CreateUserId,CreateUserName,CreateTime,UpdateCityId,UpdateCityName,UpdateCompanyId,UpdateCompanyName,UpdateDepartmentId,UpdateDepartmentName,UpdateUserId,UpdateUserName,UpdateTime,VenderTel,VenderAddress,BuyerAddress,BuyerTel,EvaluatePrice,LonggevityLevel,LoanBank,EvaluateCompany,FundLoanPrice,FundLoanEndYear,BusinessLoanPrice,BusinessLoanEndYear,Prejudication,TransferDate ");
            strSql.Append(" FROM t_Business_Record_BaseInfo ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business");
            return db.ExecuteDataSet(CommandType.Text, strSql.ToString());
        }

        /// <summary>
        /// 获得数据列表（比DataSet效率高，推荐使用）
        /// </summary>
        public static List<Chenxin.Lib.Business.Entity.t_Business_Record_BaseInfo> GetListArray(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select RecordId,HouseId,HouseCode,HouseAddress,BuildingArea,PropertyCode,CompleteYear,Total_Floor,Cur_Floor,BuildingType,HouseUse,BelongUserCityId,BelongUserCityName,BelongUserCompanyId,BelongUserCompanyName,BelongUserDepartmentId,BelongUserDepartmentName,BelongUserId,BelongUserName,CityId,CityName,CompanyId,CompanyName,DepartId,DepartName,EmployeeId,Employee,LoanInfo,BargainTime,LoanTime,BargainType,WorkCityId,WorkCityName,WorkCompanyId,WorkCompanyName,WorkDepartId,WorkDepartName,WorkPersonId,WorkPersonName,BargainCityId,BargainCityName,BargainCompanyId,BargainCompanyName,Mobile,SpecialInfo,TotalPrice,Unit,FitPrice,MortgageInfo,FariInfo,PayLoanDay,PayMode,RepairFund,GiveHouseTime,Remark,FairPoint,LoanAnswerContent,LoanIsAnswer,LawAnswerContent,LawIsAnswer,ApplyDocAnswerContent,ApplyDocIsAnswer,AnswersNum,IsAnswer,AnswerTime,Status,CreateCityId,CreateCityName,CreateCompanyId,CreateCompanyName,CreateDepartmentId,CreateDepartmentName,CreateUserId,CreateUserName,CreateTime,UpdateCityId,UpdateCityName,UpdateCompanyId,UpdateCompanyName,UpdateDepartmentId,UpdateDepartmentName,UpdateUserId,UpdateUserName,UpdateTime,VenderTel,VenderAddress,BuyerAddress,BuyerTel,EvaluatePrice,LonggevityLevel,LoanBank,EvaluateCompany,FundLoanPrice,FundLoanEndYear,BusinessLoanPrice,BusinessLoanEndYear,Prejudication,TransferDate ");
            strSql.Append(" FROM t_Business_Record_BaseInfo ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            List<Chenxin.Lib.Business.Entity.t_Business_Record_BaseInfo> list = new List<Chenxin.Lib.Business.Entity.t_Business_Record_BaseInfo>();
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business");
            using (IDataReader dataReader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
            {
                while (dataReader.Read())
                {
                    list.Add(ReaderBind(dataReader));
                }
                dataReader.Close();
                dataReader.Dispose();
            }
            return list;
        }

        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public static DataSet GetList(int PageIndex, int PageSize, String OrderField, string TableName, string StrWhere, string FieldList, string TableFieldList, bool DoCount)
        {
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business_Search");
            DbCommand dbCommand = db.GetStoredProcCommand("PagerMultiTable");
            db.AddInParameter(dbCommand, "PageIndex", DbType.Int32, PageIndex);
            db.AddInParameter(dbCommand, "PageSize", DbType.Int32, PageSize);
            db.AddInParameter(dbCommand, "OrderField", DbType.AnsiString, OrderField);
            db.AddInParameter(dbCommand, "TableName", DbType.AnsiString, TableName);
            db.AddInParameter(dbCommand, "StrWhere", DbType.AnsiString, StrWhere);
            db.AddInParameter(dbCommand, "FieldList", DbType.AnsiString, FieldList);
            db.AddInParameter(dbCommand, "TableFieldList", DbType.AnsiString, TableFieldList);
            db.AddInParameter(dbCommand, "DoCount", DbType.Boolean, DoCount);
            return db.ExecuteDataSet(dbCommand);
        }

        /// <summary>
        /// 对象实体绑定数据
        /// </summary>
        public static Chenxin.Lib.Business.Entity.t_Business_Record_BaseInfo ReaderBind(IDataReader dataReader)
        {
            Chenxin.Lib.Business.Entity.t_Business_Record_BaseInfo model = new Chenxin.Lib.Business.Entity.t_Business_Record_BaseInfo();
            object ojb;
            ojb = dataReader["RecordId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.RecordId = new Guid(ojb.ToString());
            }
            ojb = dataReader["HouseId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.HouseId = new Guid(ojb.ToString());
            }
            model.HouseCode = dataReader["HouseCode"].ToString();
            model.HouseAddress = dataReader["HouseAddress"].ToString();
            model.PropertyCode = dataReader["PropertyCode"].ToString();
            ojb = dataReader["BuildingArea"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.BuildingArea = (decimal)ojb;
            }
            model.CompleteYear = dataReader["CompleteYear"].ToString();
            ojb = dataReader["Total_Floor"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.Total_Floor = (int)ojb;
            }
            ojb = dataReader["Cur_Floor"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.Cur_Floor = (int)ojb;
            }
            model.BuildingType = dataReader["BuildingType"].ToString();
            model.HouseUse = dataReader["HouseUse"].ToString();
            ojb = dataReader["BelongUserCityId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.BelongUserCityId = new Guid(ojb.ToString());
            }
            model.BelongUserCityName = dataReader["BelongUserCityName"].ToString();
            ojb = dataReader["BelongUserCompanyId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.BelongUserCompanyId = new Guid(ojb.ToString());
            }
            model.BelongUserCompanyName = dataReader["BelongUserCompanyName"].ToString();
            ojb = dataReader["BelongUserDepartmentId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.BelongUserDepartmentId = new Guid(ojb.ToString());
            }
            model.BelongUserDepartmentName = dataReader["BelongUserDepartmentName"].ToString();
            ojb = dataReader["BelongUserId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.BelongUserId = new Guid(ojb.ToString());
            }
            model.BelongUserName = dataReader["BelongUserName"].ToString();
            ojb = dataReader["CityId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.CityId = new Guid(ojb.ToString());
            }
            model.CityName = dataReader["CityName"].ToString();
            ojb = dataReader["CompanyId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.CompanyId = new Guid(ojb.ToString());
            }
            model.CompanyName = dataReader["CompanyName"].ToString();
            ojb = dataReader["DepartId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.DepartId = new Guid(ojb.ToString());
            }
            model.DepartName = dataReader["DepartName"].ToString();
            ojb = dataReader["EmployeeId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.EmployeeId = new Guid(ojb.ToString());
            }
            model.Employee = dataReader["Employee"].ToString();
            model.LoanInfo = dataReader["LoanInfo"].ToString();
            ojb = dataReader["BargainTime"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.BargainTime = (DateTime)ojb;
            }
            ojb = dataReader["LoanTime"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.LoanTime = (DateTime)ojb;
            }
            model.BargainType = dataReader["BargainType"].ToString();
            ojb = dataReader["WorkCityId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.WorkCityId = new Guid(ojb.ToString());
            }
            model.WorkCityName = dataReader["WorkCityName"].ToString();
            ojb = dataReader["WorkCompanyId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.WorkCompanyId = new Guid(ojb.ToString());
            }
            model.WorkCompanyName = dataReader["WorkCompanyName"].ToString();
            ojb = dataReader["WorkDepartId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.WorkDepartId = new Guid(ojb.ToString());
            }
            model.WorkDepartName = dataReader["WorkDepartName"].ToString();
            ojb = dataReader["WorkPersonId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.WorkPersonId = new Guid(ojb.ToString());
            }
            model.WorkPersonName = dataReader["WorkPersonName"].ToString();
            ojb = dataReader["BargainCityId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.BargainCityId = new Guid(ojb.ToString());
            }
            model.BargainCityName = dataReader["BargainCityName"].ToString();
            ojb = dataReader["BargainCompanyId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.BargainCompanyId = new Guid(ojb.ToString());
            }
            model.BargainCompanyName = dataReader["BargainCompanyName"].ToString();
            model.Mobile = dataReader["Mobile"].ToString();
            model.SpecialInfo = dataReader["SpecialInfo"].ToString();
            ojb = dataReader["TotalPrice"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.TotalPrice = (decimal)ojb;
            }
            model.Unit = dataReader["Unit"].ToString();
            ojb = dataReader["FitPrice"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.FitPrice = (decimal)ojb;
            }
            model.MortgageInfo = dataReader["MortgageInfo"].ToString();
            model.FariInfo = dataReader["FariInfo"].ToString();
            model.PayLoanDay = dataReader["PayLoanDay"].ToString();
            model.PayMode = dataReader["PayMode"].ToString();
            model.RepairFund = dataReader["RepairFund"].ToString();
            model.GiveHouseTime = dataReader["GiveHouseTime"].ToString();        
            model.Remark = dataReader["Remark"].ToString();
            model.FairPoint = dataReader["FairPoint"].ToString();
            model.LoanAnswerContent = dataReader["LoanAnswerContent"].ToString();
            ojb = dataReader["LoanIsAnswer"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.LoanIsAnswer = (bool)ojb;
            }
            model.LawAnswerContent = dataReader["LawAnswerContent"].ToString();
            ojb = dataReader["LawIsAnswer"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.LawIsAnswer = (bool)ojb;
            }
            model.ApplyDocAnswerContent = dataReader["ApplyDocAnswerContent"].ToString();
            ojb = dataReader["ApplyDocIsAnswer"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.ApplyDocIsAnswer = (bool)ojb;
            }
            ojb = dataReader["AnswersNum"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.AnswersNum = (int)ojb;
            }
            ojb = dataReader["IsAnswer"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.IsAnswer = (bool)ojb;
            }
            ojb = dataReader["AnswerTime"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.AnswerTime = (DateTime)ojb;
            }
            ojb = dataReader["Status"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.Status = (int)ojb;
            }
            ojb = dataReader["CreateCityId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.CreateCityId = new Guid(ojb.ToString());
            }
            model.CreateCityName = dataReader["CreateCityName"].ToString();
            ojb = dataReader["CreateCompanyId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.CreateCompanyId = new Guid(ojb.ToString());
            }
            model.CreateCompanyName = dataReader["CreateCompanyName"].ToString();
            ojb = dataReader["CreateDepartmentId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.CreateDepartmentId = new Guid(ojb.ToString());
            }
            model.CreateDepartmentName = dataReader["CreateDepartmentName"].ToString();
            ojb = dataReader["CreateUserId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.CreateUserId = new Guid(ojb.ToString());
            }
            model.CreateUserName = dataReader["CreateUserName"].ToString();
            ojb = dataReader["CreateTime"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.CreateTime = (DateTime)ojb;
            }
            ojb = dataReader["UpdateCityId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.UpdateCityId = new Guid(ojb.ToString());
            }
            model.UpdateCityName = dataReader["UpdateCityName"].ToString();
            ojb = dataReader["UpdateCompanyId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.UpdateCompanyId = new Guid(ojb.ToString());
            }
            model.UpdateCompanyName = dataReader["UpdateCompanyName"].ToString();
            ojb = dataReader["UpdateDepartmentId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.UpdateDepartmentId = new Guid(ojb.ToString());
            }
            model.UpdateDepartmentName = dataReader["UpdateDepartmentName"].ToString();
            ojb = dataReader["UpdateUserId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.UpdateUserId = new Guid(ojb.ToString());
            }
            model.UpdateUserName = dataReader["UpdateUserName"].ToString();
            ojb = dataReader["UpdateTime"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.UpdateTime = (DateTime)ojb;
            }
            model.VenderTel = dataReader["VenderTel"].ToString();
            model.VenderAddress = dataReader["VenderAddress"].ToString();
            model.BuyerAddress = dataReader["BuyerAddress"].ToString();
            model.BuyerTel = dataReader["BuyerTel"].ToString();
            ojb = dataReader["EvaluatePrice"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.EvaluatePrice = (decimal)ojb;
            }
            model.LonggevityLevel = dataReader["LonggevityLevel"].ToString();
            model.LoanBank = dataReader["LoanBank"].ToString();
            model.EvaluateCompany = dataReader["EvaluateCompany"].ToString();
            ojb = dataReader["FundLoanPrice"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.FundLoanPrice = (decimal)ojb;
            }
            model.FundLoanEndYear = dataReader["FundLoanEndYear"].ToString();
            ojb = dataReader["BusinessLoanPrice"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.BusinessLoanPrice = (decimal)ojb;
            }
            model.BusinessLoanEndYear = dataReader["BusinessLoanEndYear"].ToString();
            model.Prejudication = dataReader["Prejudication"].ToString();
            ojb = dataReader["TransferDate"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.TransferDate = (DateTime)ojb;
            }
            return model;
        }
        #endregion  成员方法
    }
}

